package com.gukun.springboot.tdengine.domain.enums;

/**
 * @author zhang
 * 备份恢复任务类型
 */
public enum BackupRecoverTaskType {
    DATABASE_DATA(1),
    DATABASE_SCHEMA(2);
    private final int type;
    BackupRecoverTaskType(int type) {
        this.type = type;
    }
    public int getType() {
        return type;
    }

    public static BackupRecoverTaskType getType(int type) {
        for (BackupRecoverTaskType value : BackupRecoverTaskType.values()) {
            if (value.getType() == type) {
                return value;
            }
        }
        return null;
    }

    public static int getType(BackupRecoverTaskType type) {
        for (BackupRecoverTaskType value : BackupRecoverTaskType.values()) {
            if (value.getType() == type.getType()) {
                return value.getType();
            }
        }
        return -1;
    }
}
